<template>
    <div class="person-arch" v-title :data-title="headTitle">
        <headerTop :title="headTitle"></headerTop>
        <selectProject :projectName="selectProjectName" :infoId="infoId"/>
        <div class="office-content-repair itemMargin-bot" v-if="repairStatus">
            <div class="repair-title">
                <span>补报</span>
                <span>日期</span>
            </div>
            <div class="item-content">
                <van-field v-model="info.repairDate"  placeholder="请输入格式为20200925的日期" label-width="75"/>
            </div>
        </div>
        <div class="person-content">
            <span class="item-title">整理</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="zhengLiOpen=!zhengLiOpen">
                    <span :style="{color:(info.zhengNum || info.zhengMark)?'#007CF9':'#7D8082'}">
                        {{info.zhengNum || info.zhengMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="zhengLiOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="zhengLiOpen">
                    <van-field v-model="info.zhengNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入整理数量"
                               label-width="70"/>
                    <van-field v-model="info.zhengMark" type="textarea" label="补充描述" placeholder="请输入整理补充描述"
                               label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>

        <div class="person-content itemMargin">
            <span class="item-title">分十大类</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="fenLeiOpen=!fenLeiOpen">
                    <span :style="{color:(info.fenNum || info.fenMark)?'#007CF9':'#7D8082'}">
                        {{info.fenNum || info.fenMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="fenLeiOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="fenLeiOpen">
                    <van-field v-model="info.fenNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入分十大类数量"
                               label-width="70"/>
                    <van-field v-model="info.fenMark" type="textarea" label="补充描述" placeholder="请输入分十大类补充描述"
                               label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">编码</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="bianMaOpen=!bianMaOpen">
                    <span :style="{color:(info.bianNum || info.bianMark)?'#007CF9':'#7D8082'}">
                        {{info.bianNum || info.bianMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="bianMaOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="bianMaOpen">
                    <van-field v-model="info.bianNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入编码数量"
                               label-width="70"/>
                    <van-field v-model="info.bianMark" type="textarea" label="补充描述" placeholder="请输入编码补充描述" label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">录入</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="luRuOpen=!luRuOpen">
                    <span :style="{color:(info.luNum || info.luSubNum || info.luMark)?'#007CF9':'#7D8082'}">
                        {{info.luNum || info.luSubNum || info.luMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="luRuOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="luRuOpen">
                    <van-field v-model="info.luNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入录入数量"
                               label-width="70"/>
                    <van-field v-model="info.luSubNum" maxlength="9" type="digit" label="数量(条)" placeholder="请输入录入条数"
                               label-width="70"/>
                    <van-field v-model="info.luMark" type="textarea" label="补充描述" placeholder="请输入录入补充描述" label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">查缺</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="chaQueOpen=!chaQueOpen">
                    <span :style="{color:(info.chaNum || info.chaMark)?'#007CF9':'#7D8082'}">
                        {{info.chaNum || info.chaMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="chaQueOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="chaQueOpen">
                    <van-field v-model="info.chaNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入查缺数量"
                               label-width="70"/>
                    <van-field v-model="info.chaMark" type="textarea" label="补充描述" placeholder="请输入查缺补充描述" label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">扫描</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="saoMiaoOpen=!saoMiaoOpen">
                    <span :style="{color:(info.scanNum || info.scanPage || info.scanMark)?'#007CF9':'#7D8082'}">
                        {{info.scanNum || info.scanPage || info.scanMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="saoMiaoOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="saoMiaoOpen">
                    <van-field v-model="info.scanNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入扫描数量"
                               label-width="70"/>
                    <van-field v-model="info.scanPage" maxlength="9" type="digit" label="数量(页)" placeholder="请输入扫描页数"
                               label-width="70"/>
                    <van-field v-model="info.scanMark" type="textarea" label="补充描述" placeholder="请输入扫描补充描述" label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">修图</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="xiuTuOpen=!xiuTuOpen">
                    <span :style="{color:(info.xiuNun || info.xiuSubNum || info.xiuMark)?'#007CF9':'#7D8082'}">
                        {{info.xiuNun || info.xiuSubNum || info.xiuMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="xiuTuOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="xiuTuOpen">
                    <van-field v-model="info.xiuNun" maxlength="9" type="digit" label="数量(本)" placeholder="请输入修图数量"
                               label-width="70"/>
                    <van-field v-model="info.xiuSubNum" maxlength="9" type="digit" label="数量(页)" placeholder="请输入修图页数"
                               label-width="70"/>
                    <van-field v-model="info.xiuMark" type="textarea" label="补充描述" placeholder="请输入修图补充描述" label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">回插</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="huiChaOpen=!huiChaOpen">
                    <span :style="{color:(info.huiNum || info.huiMark)?'#007CF9':'#7D8082'}">
                        {{info.huiNum || info.huiMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="huiChaOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="huiChaOpen">
                    <van-field v-model="info.huiNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入回插数量"
                               label-width="70"/>
                    <van-field v-model="info.huiMark" type="textarea" label="补充描述" placeholder="请输入回插补充描述" label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">专审</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="zhuanshenOpen=!zhuanshenOpen">
                    <span :style="{color:(info.zhuanNum || info.zhuanMark)?'#007CF9':'#7D8082'}">
                        {{info.zhuanNum || info.zhuanMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="zhuanshenOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="zhuanshenOpen">
                    <van-field v-model="info.zhuanNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入专审数量"
                               label-width="70"/>
                    <van-field v-model="info.zhuanMark" type="textarea" label="补充描述" placeholder="请输入专审补充描述"
                               label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">认定</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="renDingOpen=!renDingOpen">
                    <span :style="{color:(info.renNum || info.renMark)?'#007CF9':'#7D8082'}">
                        {{info.renNum || info.renMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="renDingOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="renDingOpen">
                    <van-field v-model="info.renNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入认定数量"
                               label-width="70"/>
                    <van-field v-model="info.renMark" type="textarea" label="补充描述" placeholder="请输入认定补充描述" label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">制大表</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="zhiDaBiaoOpen=!zhiDaBiaoOpen">
                    <span :style="{color:(info.zhiNum || info.zhiMark)?'#007CF9':'#7D8082'}">
                        {{info.zhiNum || info.zhiMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="zhiDaBiaoOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="zhiDaBiaoOpen">
                    <van-field v-model="info.zhiNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入制大表数量"
                               label-width="70"/>
                    <van-field v-model="info.zhiMark" type="textarea" label="补充描述" placeholder="请输入制大表补充描述" label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>
        <div class="person-content itemMargin">
            <span class="item-title">质检装订</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="zhiJIanZhuangDingOpen=!zhiJIanZhuangDingOpen">
                    <span :style="{color:(info.zhaungNum || info.zhaungMark)?'#007CF9':'#7D8082'}">
                        {{info.zhaungNum || info.zhaungMark?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="zhiJIanZhuangDingOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="zhiJIanZhuangDingOpen">
                    <van-field v-model="info.zhaungNum" maxlength="9" type="digit" label="数量(本)" placeholder="请输入质检装订数量"
                               label-width="70"/>
                    <van-field v-model="info.zhaungMark" type="textarea" label="补充描述" placeholder="请输入质检装订补充描述"
                               label-width="70"
                               rows="2" :autosize="true"/>
                </div>

            </div>
        </div>

        <div class="person-content itemMargin">
            <span class="item-title">其他</span>
            <div class="item-content">
                <van-field v-model="info.otherMark" type="textarea" label="其他描述" placeholder="请输入其他补充描述"
                           label-width="70"
                           rows="2" :autosize="true"/>
            </div>
        </div>

        <div class="person-content itemMargin">
            <span class="item-title">工作量</span>
            <div class="item-content">
                <div class="item-arrow-down" @click="workOpen=!workOpen">
                    <span :style="{color:workDay?'#007CF9':'#7D8082'}">
                        {{workDay?'已填写':'未填写'}}
                    </span>
                    <van-icon :name="workOpen?'arrow-up':'arrow-down'" />
                </div>
                <div v-if="workOpen">
                    <div class="work-day">
                        <span class="work-day-title">工作量</span>
                        <span class="work-day-select" :style="{color:workDay?'#323233':'#969799'}"
                              @click="selectWorkDay">{{workDay?workDay+'天':'请选择工作量'}}</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="person-commit">
            <van-button round type="info" style="width: 100%;font-size: 18px;"
                        @click="startCommit">{{repairStatus?'申请':'填报'}}
            </van-button>
        </div>

        <van-popup v-model="isShowPersonPopu" position="bottom" round closeable>
            <div class="commit-show" :style="{maxHeight:screenHeight>500?commitPopuHeight+'px':screenHeight+'px'}">
                <div class="commit-title">{{repairStatus?'申请信息确认':'填报信息确认'}}</div>
                <div class="commit-item">
                    <span class="commit-item-title">项目</span>
                    <div class="commit-item-content">
                        <span>{{selectProjectName}}</span>
                    </div>
                </div>
                <div class="bottomLine"></div>
                <div class="commit-item" v-if="repairStatus">
                    <span class="commit-item-title">补报日期</span>
                    <div class="commit-item-content">
                        <span>{{info.repairDate}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="repairStatus"></div>
                <div class="commit-item" v-if="info.zhengNum || info.zhengMark">
                    <span class="commit-item-title">整理</span>
                    <div class="commit-item-content">
                        <span v-if="info.zhengNum">数量(本)：{{info.zhengNum}}</span>
                        <span class="item-txt-top" v-if="info.zhengMark">补充描述：{{info.zhengMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.zhengNum || info.zhengMark"></div>
                <div class="commit-item" v-if="info.fenNum || info.fenMark">
                    <span class="commit-item-title">分类</span>
                    <div class="commit-item-content">
                        <span v-if="info.fenNum">数量(本)：{{info.fenNum}}</span>
                        <span class="item-txt-top" v-if="info.fenMark">补充描述：{{info.fenMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.fenNum || info.fenMark"></div>

                <div class="commit-item" v-if="info.bianNum || info.bianMark">
                    <span class="commit-item-title">编码</span>
                    <div class="commit-item-content">
                        <span v-if="info.bianNum">数量(本)：{{info.bianNum}}</span>
                        <span class="item-txt-top" v-if="info.bianMark">补充描述：{{info.bianMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.bianNum || info.bianMark"></div>

                <div class="commit-item" v-if="info.luNum || info.luSubNum || info.luMark">
                    <span class="commit-item-title">录入</span>
                    <div class="commit-item-content">
                        <span v-if="info.luNum">数量(本)：{{info.luNum}}</span>
                        <span class="item-txt-top" v-if="info.luSubNum">数量(条)：{{info.luSubNum}}</span>
                        <span class="item-txt-top" v-if="info.luMark">补充描述：{{info.luMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.luNum || info.luSubNum || info.luMark"></div>

                <div class="commit-item" v-if="info.chaNum || info.chaMark">
                    <span class="commit-item-title">查缺</span>
                    <div class="commit-item-content">
                        <span v-if="info.chaNum">数量(本)：{{info.chaNum}}</span>
                        <span class="item-txt-top" v-if="info.chaMark">补充描述：{{info.chaMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.chaNum || info.chaMark"></div>

                <div class="commit-item" v-if="info.scanNum || info.scanPage || info.scanMark">
                    <span class="commit-item-title">扫描</span>
                    <div class="commit-item-content">
                        <span v-if="info.scanNum">数量(本)：{{info.scanNum}}</span>
                        <span class="item-txt-top" v-if="info.scanPage">数量(页)：{{info.scanPage}}</span>
                        <span class="item-txt-top" v-if="info.scanMark">补充描述：{{info.scanMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.scanNum || info.scanPage || info.scanMark"></div>

                <div class="commit-item" v-if="info.xiuNun || info.xiuSubNum || info.xiuMark">
                    <span class="commit-item-title">修图</span>
                    <div class="commit-item-content">
                        <span v-if="info.xiuNun">数量(本)：{{info.xiuNun}}</span>
                        <span class="item-txt-top" v-if="info.xiuSubNum">数量(页)：{{info.xiuSubNum}}</span>
                        <span class="item-txt-top" v-if="info.xiuMark">补充描述：{{info.xiuMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.xiuNun || info.xiuSubNum || info.xiuMark"></div>

                <div class="commit-item" v-if="info.huiNum || info.huiMark">
                    <span class="commit-item-title">回插</span>
                    <div class="commit-item-content">
                        <span v-if="info.huiNum">数量(本)：{{info.huiNum}}</span>
                        <span class="item-txt-top" v-if="info.huiMark">补充描述：{{info.huiMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.huiNum || info.huiMark"></div>

                <div class="commit-item" v-if="info.zhuanNum || info.zhuanMark">
                    <span class="commit-item-title">专审</span>
                    <div class="commit-item-content">
                        <span v-if="info.zhuanNum">数量(本)：{{info.zhuanNum}}</span>
                        <span class="item-txt-top" v-if="info.zhuanMark">补充描述：{{info.zhuanMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.zhuanNum || info.zhuanMark"></div>

                <div class="commit-item" v-if="info.renNum || info.renMark">
                    <span class="commit-item-title">认定</span>
                    <div class="commit-item-content">
                        <span v-if="info.renNum">数量(本)：{{info.renNum}}</span>
                        <span class="item-txt-top" v-if="info.renMark">补充描述：{{info.renMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.renNum || info.renMark"></div>

                <div class="commit-item" v-if="info.zhiNum || info.zhiMark">
                    <span class="commit-item-title">制大表</span>
                    <div class="commit-item-content">
                        <span v-if="info.zhiNum">数量(本)：{{info.zhiNum}}</span>
                        <span class="item-txt-top" v-if="info.zhiMark">补充描述：{{info.zhiMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.zhiNum || info.zhiMark"></div>

                <div class="commit-item" v-if="info.zhaungNum || info.zhaungMark">
                    <span class="commit-item-title">质检装订</span>
                    <div class="commit-item-content">
                        <span v-if="info.zhaungNum">数量(本)：{{info.zhaungNum}}</span>
                        <span class="item-txt-top" v-if="info.zhaungMark">补充描述：{{info.zhaungMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.zhaungNum || info.zhaungMark"></div>

                <div class="commit-item" v-if="info.otherMark">
                    <span class="commit-item-title">其他</span>
                    <div class="commit-item-content">
                        <span v-if="info.otherMark">其他描述：{{info.otherMark}}</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="info.otherMark"></div>
                <div class="commit-item" v-if="workDay">
                    <span class="commit-item-title">工作量</span>
                    <div class="commit-item-content">
                        <span>{{workDay}}天</span>
                    </div>
                </div>
                <div class="bottomLine" v-if="workDay"></div>

                <div class="person-commit-notice">
                    <van-button round type="info" style="width: 100%;font-size: 18px;" @click="startSureCommit">{{repairStatus?'确认申请':'确认填报'}}</van-button>
                </div>
            </div>
        </van-popup>
        <van-popup v-model="isShowSelectWorkPopu" position="bottom" round>
            <van-picker
                    title="请选择工作量"
                    show-toolbar
                    :columns="columnsWork"
                    :default-index="0"
                    :visible-item-count="6"
                    @confirm="onConfirmWork"
                    @cancel="onCancelWorok"/>
        </van-popup>
    </div>
</template>

<script>
    import headerTop from "@/components/headerTop";
    import selectProject from "@/components/selectProject"
    import {dismissLoading, nofity, showLoading, toast} from "@/utils/notify";


    export default {
        name: "personnelArch",
        components: {
            headerTop,
            selectProject
        },
        data() {
            return {
                zhengLiOpen:false,
                fenLeiOpen:false,
                bianMaOpen:false,
                luRuOpen:false,
                chaQueOpen:false,
                saoMiaoOpen:false,
                xiuTuOpen:false,
                huiChaOpen:false,
                zhuanshenOpen:false,
                renDingOpen:false,
                zhiDaBiaoOpen:false,
                zhiJIanZhuangDingOpen:false,
                isShowPersonPopu:false,
                selectProjectName: '',
                selectProjectId: '',
                repairStatus:false,
                info: {
                    zhengNum: '',
                    zhengMark: '',
                    fenNum: '',
                    fenMark: '',
                    bianNum: '',
                    bianMark: '',
                    luNum: '',
                    luSubNum: '',
                    luMark: '',
                    chaNum: '',
                    chaMark: '',
                    scanNum: '',
                    scanPage: '',
                    scanMark: '',
                    xiuNun: '',
                    xiuSubNum: '',
                    xiuMark: '',
                    huiNum: '',
                    huiMark: '',
                    zhuanNum: '',
                    zhuanMark: '',
                    renNum: '',
                    renMark: '',
                    zhiNum: '',
                    zhiMark: '',
                    zhaungNum: '',
                    zhaungMark: '',
                    otherMark: '',
                    repairDate:''
                },
                commitPopuHeight:0,
                screenHeight:0,
                infoId:'',
                isSelectProject:false,
                projectType:'',
                headTitle:'人事档案',
                modifyManager:0,
                isShowSelectWorkPopu:false,
                workDay:'',
                workOpen:false,
                columnsWork: ['0.5天', '1天'],
            }
        },
        methods: {
            onConfirmWork(value){
                if (value=='0.5天'){
                    this.workDay='0.5'
                }else {
                    this.workDay='1'
                }
                localStorage.workDay = this.workDay
                this.isShowSelectWorkPopu=false
            },
            selectWorkDay(){
                this.isShowSelectWorkPopu=true
            },
            onCancelWorok(){
                this.isShowSelectWorkPopu=false
            },
            startCommit() {
                if (this.selectProjectId == '') {
                    toast("请选择项目名称")
                    return
                }
                if (this.repairStatus) {
                    if (this.info.repairDate==''){
                        toast("请输入补报日期")
                        return
                    }
                }
                if (!this.workDay){
                    toast("请选择工作量")
                    return
                }
                this.isShowPersonPopu=true
            },
            startSureCommit(){
                showLoading()
                let data = []
                let zl = {
                    name: 'zl',
                    num: parseInt(this.info.zhengNum ? this.info.zhengNum : 0),
                    subNum: 0,
                    text: this.info.zhengMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(zl)

                let fsdl = {
                    name: 'fsdl',
                    num: parseInt(this.info.fenNum ? this.info.fenNum : 0),
                    subNum: 0,
                    text: this.info.fenMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(fsdl)

                let bm = {
                    name: 'bm',
                    num: parseInt(this.info.bianNum ? this.info.bianNum : 0),
                    subNum: 0,
                    text: this.info.bianMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(bm)

                let lr = {
                    name: 'lr',
                    num: parseInt(this.info.luNum ? this.info.luNum : 0),
                    subNum: parseInt(this.info.luSubNum ? this.info.luSubNum : 0),
                    text: this.info.luMark,
                    unit:'本',
                    subUnit:'条'
                }
                data.push(lr)

                let cq = {
                    name: 'cq',
                    num: parseInt(this.info.chaNum ? this.info.chaNum : 0),
                    subNum: 0,
                    text: this.info.chaMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(cq)

                let sm = {
                    name: 'sm',
                    num: parseInt(this.info.scanNum ? this.info.scanNum : 0),
                    subNum: parseInt(this.info.scanPage ? this.info.scanPage : 0),
                    text: this.info.scanMark,
                    unit:'本',
                    subUnit:'页'
                }
                data.push(sm)
                let xt = {
                    name: 'xt',
                    num: parseInt(this.info.xiuNun ? this.info.xiuNun : 0),
                    subNum: parseInt(this.info.xiuSubNum ? this.info.xiuSubNum : 0),
                    text: this.info.xiuMark,
                    unit:'本',
                    subUnit:'页'
                }
                data.push(xt)
                let hc = {
                    name: 'hc',
                    num: parseInt(this.info.huiNum ? this.info.huiNum : 0),
                    subNum: 0,
                    text: this.info.huiMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(hc)

                let zs = {
                    name: 'zs',
                    num: parseInt(this.info.zhuanNum ? this.info.zhuanNum : 0),
                    subNum: 0,
                    text: this.info.zhuanMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(zs)

                let rd = {
                    name: 'rd',
                    num: parseInt(this.info.renNum ? this.info.renNum : 0),
                    subNum: 0,
                    text: this.info.renMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(rd)

                let zdb = {
                    name: 'zdb',
                    num: parseInt(this.info.zhiNum ? this.info.zhiNum : 0),
                    subNum: 0,
                    text: this.info.zhiMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(zdb)

                let zjzd = {
                    name: 'zjzd',
                    num: parseInt(this.info.zhaungNum ? this.info.zhaungNum : 0),
                    subNum: 0,
                    text: this.info.zhaungMark,
                    unit:'本',
                    subUnit:''
                }
                data.push(zjzd)

                let qt = {
                    name: 'qt',
                    num: 0,
                    subNum: 0,
                    text: this.info.otherMark
                }
                data.push(qt)

                let params = {
                    reportJson: JSON.stringify(data),
                    projectId: this.selectProjectId,
                    reportType:this.projectType
                }
                params.workDay=this.workDay
                if (this.infoId) {
                    params.infoId = this.infoId
                }
                if(this.repairStatus){
                    params.repairStatus=true;
                    params.repairDate=this.info.repairDate;
                }
                let callBack = (res) => {
                    dismissLoading()
                    if (this.repairStatus){
                        if (this.infoId) {
                            nofity("申请更新成功,等待审核")
                        }else {
                            nofity("申请成功,等待审核")
                        }
                    }else {
                        if (this.infoId) {
                            nofity("修改成功")
                        }else {
                            nofity("填报成功")
                        }
                    }

                    this.isShowPersonPopu=false
                    setTimeout(() => {
                        if (this.repairStatus){
                            if (this.infoId) {
                                this.$router.back(-1)
                            }else {
                                this.$router.push({
                                    name: "repairRecord",
                                    query:{
                                        tabActive:'1'
                                    }
                                })
                            }
                        }else {
                            if (this.infoId) {
                                this.$router.back(-1)
                            }else {
                                this.$router.push({
                                    name: "record",
                                    query:{
                                        tabActive:'6'
                                    }
                                })
                            }
                        }

                        this.initData()
                    }, 1100)
                }
                let errback = () => {
                    dismissLoading()
                }
                if (this.infoId) {
                    if (this.modifyManager>1){
                        this.$request('POST', "/api/mobile/report/modifyReportInfoForAdmin", params, callBack, this, errback)
                    }else {
                        this.$request('POST', "/api/mobile/report/modifyReportInfo", params, callBack, this, errback)
                    }
                } else {
                    this.$request('POST', "/api/mobile/report/addReport", params, callBack, this,errback)
                }

            },
            initData() {
                this.selectProjectName = ''
                this.selectProjectId = ''
                this.info.xiuSubNum = ''
                this.info.xiuNun = ''
                this.info.scanMark = ''
                this.info.scanPage = ''
                this.info.scanNum = ''
                this.info.chaMark = ''
                this.info.chaNum = ''
                this.info.luMark = ''
                this.info.luSubNum = ''
                this.info.luNum = ''
                this.info.bianMark = ''
                this.info.bianNum = ''
                this.info.fenMark = ''
                this.info.fenNum = ''
                this.info.zhengNum = ''
                this.info.zhengMark = ''
                this.info.xiuMark = ''
                this.info.otherMark = ''
                this.info.zhaungMark = ''
                this.info.zhaungNum = ''
                this.info.zhiMark = ''
                this.info.zhiNum = ''
                this.info.renMark = ''
                this.info.renNum = ''
                this.info.zhuanMark = ''
                this.info.zhuanNum = ''
                this.info.huiMark = ''
                this.info.huiNum = ''
                this.repairStatus=false;
                this.isShowPersonPopu=false
                this.infoId=''
                this.info.repairDate=''
                this.isSelectProject=false
                this.projectType=''
                this.modifyManager=0
                this.workDay=''
            },
            getRecordById() {
                showLoading("获取中...")
                let params = {
                    infoId: this.infoId
                }
                let callBack = (res) => {
                    this.selectProjectName = res.projectName
                    this.selectProjectId = res.projectId
                    this.info.repairDate=res.reportDate
                    this.workDay=res.workDay
                    if(res.reportData.zl){
                        this.info.zhengNum=res.reportData.zl.num?res.reportData.zl.num:''
                        this.info.zhengMark=res.reportData.zl.text
                    }
                    if(res.reportData.fsdl){
                        this.info.fenNum=res.reportData.fsdl.num?res.reportData.fsdl.num:''
                        this.info.fenMark=res.reportData.fsdl.text
                    }
                    if(res.reportData.bm){
                        this.info.bianNum=res.reportData.bm.num?res.reportData.bm.num:''
                        this.info.bianMark=res.reportData.bm.text
                    }
                    if(res.reportData.lr){
                        this.info.luNum=res.reportData.lr.num?res.reportData.lr.num:''
                        this.info.luSubNum=res.reportData.lr.subNum?res.reportData.lr.subNum:''
                        this.info.luMark=res.reportData.lr.text
                    }
                    if(res.reportData.cq){
                        this.info.chaNum=res.reportData.cq.num?res.reportData.cq.num:''
                        this.info.chaMark=res.reportData.cq.text
                    }
                    if(res.reportData.sm){
                        this.info.scanNum=res.reportData.sm.num?res.reportData.sm.num:''
                        this.info.scanPage=res.reportData.sm.subNum?res.reportData.sm.subNum:''
                        this.info.scanMark=res.reportData.sm.text
                    }
                    if(res.reportData.xt){
                        this.info.xiuNun=res.reportData.xt.num?res.reportData.xt.num:''
                        this.info.xiuSubNum=res.reportData.xt.subNum?res.reportData.xt.subNum:''
                        this.info.xiuMark=res.reportData.xt.text
                    }
                    if(res.reportData.hc){
                        this.info.huiNum=res.reportData.hc.num?res.reportData.hc.num:''
                        this.info.huiMark=res.reportData.hc.text
                    }
                    if(res.reportData.zs){
                        this.info.zhuanNum=res.reportData.zs.num?res.reportData.zs.num:''
                        this.info.zhuanMark=res.reportData.zs.text
                    }
                    if(res.reportData.rd){
                        this.info.renNum=res.reportData.rd.num?res.reportData.rd.num:''
                        this.info.renMark=res.reportData.rd.text
                    }
                    if(res.reportData.zdb){
                        this.info.zhiNum=res.reportData.zdb.num?res.reportData.zdb.num:''
                        this.info.zhiMark=res.reportData.zdb.text
                    }
                    if(res.reportData.zjzd){
                        this.info.zhaungNum=res.reportData.zjzd.num?res.reportData.zjzd.num:''
                        this.info.zhaungMark=res.reportData.zjzd.text
                    }
                    if(res.reportData.qt){
                        this.info.otherMark=res.reportData.qt.text
                    }
                    dismissLoading()
                }
                let errback = () => {
                    dismissLoading()
                }
                this.$request('POST', "/api/mobile/report/find", params, callBack, this, errback)
            }
        },
        activated() {
            if (sessionStorage.getItem("selectProject")) {
                let selectData = JSON.parse(sessionStorage.getItem("selectProject"))
                this.isSelectProject=true
                this.selectProjectName = selectData.projectName
                this.selectProjectId = selectData.projectId
                sessionStorage.removeItem("selectProject")
            }
            else if(localStorage.selectProject){
                let selectData = JSON.parse(localStorage.selectProject)
                this.isSelectProject=true
                this.selectProjectName = selectData.projectName
                this.selectProjectId = selectData.projectId
            }
            else {
                this.initData()
            }
            if (localStorage.workDay){
                this.workDay = localStorage.workDay
                this.workOpen = true
            }

            if (this.$route.query.type>0){
                this.repairStatus=true;
            }
            if (this.$route.query.modifyByManager > 1) {
                this.modifyManager = 100;
            }else {
                this.modifyManager = 0;
            }
            if (this.$route.query.infoId) {
                this.infoId = this.$route.query.infoId
                if (!this.isSelectProject){
                    this.getRecordById()
                }
            }
            if (this.$route.query.projectType) {
                this.projectType = this.$route.query.projectType
                if (this.projectType=='hr'){
                    this.headTitle="人事档案"
                }
            }
            this.screenHeight=document.documentElement.clientHeight
            if (this.screenHeight>0){
                this.commitPopuHeight=this.screenHeight-80
            }
        }
    }
</script>

<style scoped lang="scss">
    .person-arch {
        min-height: 100vh;
        background: $page-bg;
        padding-top: $header-top;
        box-sizing: border-box;

        .person-content {
            background: white;
            padding: 0 10px;
            display: flex;
            align-items: flex-start;
            justify-content: flex-start;

            .item-title {
                width: 70px;
                font-size: 17px;
                color: $main-color;
                padding-top: 12px;
                flex-shrink: 0;
                font-weight: 600;
            }

            .item-content {
                flex: 1;
            }
        }

        .itemMargin {
            margin-top: 5px;
        }

        .person-commit {
            width: 90%;
            height: 45px;
            margin: 20px auto 30px;
            border-radius: 45px;
            font-size: 18px;
            text-align: center;
            line-height: 45px;
            color: #ffffff;
        }

        .office-content-repair {
            background: white;
            padding: 0 12px;
            display: flex;
            align-items: center;
            justify-content: flex-start;

            .repair-title{
                width: 70px;
                display: flex;
                align-items: flex-start;
                justify-content: flex-start;
                flex-direction: column;
                font-size: 17px;
                color: $main-color;
                flex-shrink: 0;
                font-weight: 600;
                padding: 10px 0;
            }

            .item-content {
                flex: 1;
            }
        }
        .commit-show{
            width: 100%;
            .commit-title{
                width: 100%;
                height: 55px;
                line-height: 55px;
                text-align: center;
                color: #323233;
                font-size: 17px;
            }
            .commit-item{
                background: white;
                padding: 0 12px;
                display: flex;
                align-items: flex-start;
                justify-content: flex-start;

                .commit-item-title {
                    width: 70px;
                    font-size: 16px;
                    color: $main-color;
                    flex-shrink: 0;
                }
                .commit-item-content{
                    display: flex;
                    align-items: flex-start;
                    justify-content: flex-start;
                    flex-direction: column;
                    color: #646566;
                    font-size: 15px;
                    word-break: break-all;
                }
            }
            .person-commit-notice{
                width: 90%;
                height: 45px;
                margin: 20px auto 16px;
                border-radius: 45px;
                font-size: 18px;
                text-align: center;
                line-height: 45px;
                color: #ffffff;
            }
        }
        .item-arrow-down{
            height: 40px;
            width: 100%;
            padding-right: 12px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            font-size: 13px;
            border-bottom: 1px solid #F5F6F7;
            span{
                margin-right: 20px;
            }
        }
        .work-day{
            width: 100%;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: flex-start;

            .work-day-title{
                font-size: 14px;
                color: #646566;
                flex-shrink: 0;
            }
            .work-day-select{
                width: 100%;
                height: 100%;
                line-height: 50px;
                font-size: 16px;
                color: #323233;
                padding-left: 40px;
            }
        }
    }
</style>